home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: >> File Compare Algorithm <<
- Date: 15 Apr 1996 09:22:30 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4ktt46INNpl@keats.ugrad.cs.ubc.ca>
- References: <4ksocc$pv3@uuneo.neosoft.com>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4ksocc$pv3@uuneo.neosoft.com>, <bmathai@neosoft.com> wrote:
- >I'm new to C programming and need some help.
- >
- >Does anyone know of a source where I may obtain a file compare
- >algorithm for text files? Not a binary compare algorithm, but a line
-
- Algorithms exist in textbooks and papers.
-
- >by line comparison. One that can "calibrate" itself after coming
-
- If you want code, there is GNU diff.
-
- >across mismatches in 2 files. If you could PLEASE email me your
- >response as I don't know if I can frequent this newsgroup often.
- >Thanks in advance!
-
- Example diff run:
-
- File1
-
- foo
- bar
-
- File2
-
- foo
- inserted
- stuff
- bak
-
-
- diff output:
-
- 2c2,4
- < bar
- ---
- > inserted
- > stuff
- > bak
-
- That means that line two was changed from "bar" to "inserted/stuff/bak"
-
- The diff program is used by UNIX programmers to transmit patches to source code
- in a condensed format, because the diff output can be interpreted as a set of
- editing commands to apply to an original to produce the new version.
- --
- I'm not really a jerk, but I play one on Usenet.
-